import { Modal } from 'antd';
import { type Ref, useImperativeHandle, useState } from 'react'

interface Props {
  innerRef: Ref<{showModal: (params: any) => void}> | undefined
}

const PasswordModal = (props: Props) => {
  const [modalVisible, setModalVisible] = useState(false);

  useImperativeHandle(props.innerRef, () => ({
    showModal
  }))

  const showModal = () => {
    setModalVisible(true);
  }

  const handleOk = () => {}
  const handleCancel = () => {
    setModalVisible(false);
  }

  return (
    <Modal open={modalVisible} title="修改密码" onOk={handleOk} onCancel={handleCancel}>
      <p>修改密码</p>
      <p>修改密码</p>
      <p>修改密码</p>
    </Modal>
  )
}

export default PasswordModal;